// import { Canceler } from 'axios';
import { pget, ppostJson } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 获取角色申请列表
export function getRoleApplyList(query: any) {
  return pget(`${modalApi.system}/roleApply/page`, query);
}

// 新增角色申请
export function addRoleApply(data: any) {
  return ppostJson(`${modalApi.system}/roleApply/create`, data);
}

// 修改角色申请
export function editRoleApply(data: any) {
  return ppostJson(`${modalApi.system}/roleApply/update`, data);
}

// 删除角色申请
export function deleteRole(roleId: any) {
  return ppostJson(`${modalApi.system}/roleApply/delete/${roleId}`);
}

// 查看角色申请
export function viewRoleApply(query: any) {
  return pget(`${modalApi.system}/roleApply/details`, query);
}

/** 审批角色申请 */
export function examineRoleApply(data: any) {
  return ppostJson(`${modalApi.system}/roleApply/examine`, data);
}

/** 获取导入失败列表 */
export function getRoleErrorExcelList(query: any) {
  return pget(
    `${modalApi.system}/roleApply/errorListPage`, query
  );
}

/** 保存角色申请导入数据 */
export function getImportRoleApply(query?: any) {
  return pget(
    `${modalApi.system}/roleApply/importData`,
    query,
  );
}
